﻿<% @ Page Language="C#" MasterPageFile="~/MasterPage.master" 
CodeFile="Weather.aspx.cs" Inherits="Weather" Title="每日天气预报" %>

<% @ MasterType VirtualPath="~/MasterPage.master" %>

<asp:Content ID="Content2" ContentPlaceHolderID="Content1" Runat="Server">
                
                <div style="margin-top : 30px; width : 100%">
                    <div style="z-index: 107; margin-left : 0; float : left; width : auto">
                        <asp:Image ID="Image2" ImageUrl="./Pics/weather.gif" runat="server" />
                    </div>
                    <div style="z-index: 107; margin-left : 0; float : left; width : auto">
                        <h3>侦听</h3>
                    </div>
                </div>

                <div style="margin-top : 30px; float : left; width : 100%">

                    <div style="margin-top : 10px auto; width : 100%">
                        每天准时发送今明两天的天气预报和生活指数（每个城市每月消耗积分：<b>2</b>）（<a href="./HowToSet139.aspx" >帮助？</a>）：
                    </div>
                    <div style="z-index: 107; margin-top : 20px; auto; width : 100%; height : 25px">
                        <div style="z-index: 107; float : left; width : auto">我要收听</div>

                        <div style="z-index: 107; float : left; width : auto">
                            <asp:TextBox ID="CityNameTextBox" runat="server" 
                                onfocus="if(this.value=='输入城市，或直接从列表中选择')this.value=''" 
                                onblur="if(this.value=='')this.value='输入城市，或直接从列表中选择'" 
                                type="text" maxLength="30" 
                                data-default="5,北京,010,100000;214,上海,021,200000;12,天津,022,300000;341,武汉,027,430000;185,沈阳,024,110000;490,广州,020,510000;813,重庆,023,30000;586,西安,029,710000;242,南京,025,210000;119,哈尔滨,0451,150000;" autocomplete="off" value="输入国名、地名、拼音、电话区号均可">
                             </asp:TextBox>
                        </div>

                        <div style="z-index: 107; float : left; width : auto">市的天气预报和</div>
                        <asp:CheckBox ID="CheckBox1" runat="server" Text="生活指数" style="z-index: 107; float : left; width : auto" />
                        <div style="z-index: 107; float : left; width : auto">，请在每天</div>
                        <asp:DropDownList ID="DropDownList3" runat="server" style="z-index: 107; float : left; width : auto">
                            <asp:ListItem Text="0" Value="0"></asp:ListItem>
                            <asp:ListItem Text="1" Value="1"></asp:ListItem>
                            <asp:ListItem Text="2" Value="2"></asp:ListItem>
                            <asp:ListItem Text="3" Value="3"></asp:ListItem>
                            <asp:ListItem Text="4" Value="4"></asp:ListItem>
                            <asp:ListItem Text="5" Value="5"></asp:ListItem>
                            <asp:ListItem Text="6" Value="6"></asp:ListItem>
                            <asp:ListItem Text="7" Value="7"></asp:ListItem>
                            <asp:ListItem Text="8" Value="8"></asp:ListItem>
                            <asp:ListItem Text="9" Value="9"></asp:ListItem>
                            <asp:ListItem Text="10" Value="10"></asp:ListItem>
                            <asp:ListItem Text="11" Value="11"></asp:ListItem>
                            <asp:ListItem Text="12" Value="12"></asp:ListItem>
                            <asp:ListItem Text="13" Value="13"></asp:ListItem>
                            <asp:ListItem Text="14" Value="14"></asp:ListItem>
                            <asp:ListItem Text="15" Value="15"></asp:ListItem>
                            <asp:ListItem Text="16" Value="16"></asp:ListItem>
                            <asp:ListItem Text="17" Value="17"></asp:ListItem>
                            <asp:ListItem Text="18" Value="18"></asp:ListItem>
                            <asp:ListItem Text="19" Value="19"></asp:ListItem>
                            <asp:ListItem Text="20" Value="20"></asp:ListItem>
                            <asp:ListItem Text="21" Value="21"></asp:ListItem>
                            <asp:ListItem Text="22" Value="22"></asp:ListItem>
                            <asp:ListItem Text="23" Value="23"></asp:ListItem>
                        </asp:DropDownList>

                        <div style="z-index: 107; float : left; width : auto">点发送到手机</div>

                        <asp:Button ID="Button1" runat="server" Text="侦听" class="btn-submit2 enabled2"
                        Font-Bold="True" Font-Size="Medium" OnClick="Button3_Click"  />
                   </div>  
              </div>

              <div style="float : left; margin-top : 30px; width : 100%">
                <div style="margin-top : 10px auto; width : 100%">
                您已经关注的城市，修改以后不要忘记保存哦：
                </div>
                <asp:ListView ID="ListView"
                    DataSourceID="objService"
                    onitemupdating="ListView1_ItemUpdating"
                    OnItemDeleting="ListView1_ItemDeleting"
                    OnItemCommand = "ListView1_ItemCommand"
                    runat="server" >
                    <LayoutTemplate>
                      <table cellpadding="2" class="datasheet datatable excel2007" width="640px" border="1" runat="server" id="tblProducts">
                        <tr id="Tr1" class="first" runat="server">
                          <th id="Th3" runat="server">#</th>
                          <th id="Th2" runat="server">城市</th>
                          <th id="Th4" runat="server">发送时间</th>
                          <th id="Th5" runat="server">是否发送生活指数</th>
                        </tr>
                        <tr runat="server" id="itemPlaceholder" />
                      </table>
                      <asp:DataPager runat="server" ID="DataPager" PageSize="12">
                        <Fields>
                          <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="true"
                            FirstPageText="|&lt;&lt; " LastPageText=" &gt;&gt;|"
                            NextPageText=" &gt; " PreviousPageText=" &lt; " />
                        </Fields>
                      </asp:DataPager>
                    </LayoutTemplate>
                    <ItemTemplate>
                      <tr id="Tr2" runat="server">
                        <th class="first" style="white-space:nowrap">
                          <asp:LinkButton ID="DeleteButton" runat="Server" Text="取消侦听" CommandName="Delete" />
                        </th>
                        <td valign="top">
                          <asp:Textbox ID="CityTextBox"  Enabled="false" runat="Server" AutoPostBack="true" Text ='<%#Bind("City") %>' >
                          </asp:Textbox>
                        </td>
                        <td>
                          <asp:DropDownList ID="TimeDropDownList" AutoPostBack="true" runat="Server" SelectedValue ='<%#Bind("Time") %>' >
                            <asp:ListItem Text="0点" Value="0"></asp:ListItem>
                            <asp:ListItem Text="1点" Value="1"></asp:ListItem>
                            <asp:ListItem Text="2点" Value="2"></asp:ListItem>
                            <asp:ListItem Text="3点" Value="3"></asp:ListItem>
                            <asp:ListItem Text="4点" Value="4"></asp:ListItem>
                            <asp:ListItem Text="5点" Value="5"></asp:ListItem>
                            <asp:ListItem Text="6点" Value="6"></asp:ListItem>
                            <asp:ListItem Text="7点" Value="7"></asp:ListItem>
                            <asp:ListItem Text="8点" Value="8"></asp:ListItem>
                            <asp:ListItem Text="9点" Value="9"></asp:ListItem>
                            <asp:ListItem Text="10点" Value="10"></asp:ListItem>
                            <asp:ListItem Text="11点" Value="11"></asp:ListItem>
                            <asp:ListItem Text="12点" Value="12"></asp:ListItem>
                            <asp:ListItem Text="13点" Value="13"></asp:ListItem>
                            <asp:ListItem Text="14点" Value="14"></asp:ListItem>
                            <asp:ListItem Text="15点" Value="15"></asp:ListItem>
                            <asp:ListItem Text="16点" Value="16"></asp:ListItem>
                            <asp:ListItem Text="17点" Value="17"></asp:ListItem>
                            <asp:ListItem Text="18点" Value="18"></asp:ListItem>
                            <asp:ListItem Text="19点" Value="19"></asp:ListItem>
                            <asp:ListItem Text="20点" Value="20"></asp:ListItem>
                            <asp:ListItem Text="21点" Value="21"></asp:ListItem>
                            <asp:ListItem Text="22点" Value="22"></asp:ListItem>
                            <asp:ListItem Text="23点" Value="23"></asp:ListItem>
                          </asp:DropDownList>
                        </td>
                        <td>
                          <asp:DropDownList ID="YesNoDropDownList" runat="Server" AutoPostBack="true" SelectedValue ='<%#Bind("ShouldSendZS") %>' >
                            <asp:ListItem Text="是" Value="Yes"></asp:ListItem>
                            <asp:ListItem Text="否" Value="No"></asp:ListItem>
                          </asp:DropDownList>
                        </td>
                      </tr>
                    </ItemTemplate>
            </asp:ListView>

            <asp:ObjectDataSource ID="objService" runat="server" TypeName="WeatherService"
                SelectMethod="Select" UpdateMethod="Update" DeleteMethod="Delete" 
                onobjectcreating="objService_ObjectCreating">      
            </asp:ObjectDataSource>
            <p>
                <asp:Label ID="Label2" runat="server" Text=""></asp:Label>
            </p>

            <asp:Button ID="Button4" runat="server" Text="保存我的改动" class="btn-submit enabled"
                                Font-Bold="True" Font-Size="Medium" OnClick="Button4_Click"  />
            </div>
            
    <script src="http://php.weather.sina.com.cn/js/SuggestServer_3.js" type="text/javascript"></script>
    <script type= "text/javascript">
    <!--

        //城市搜索
        (new SuggestServer()).bind({
            "input": "<%=CityNameTextBox.ClientID%>",
            "value": "@1@",
            "type": "61",
            "max": 10,
            "width": 150,
            "head": ["名称"],
            "body": [1],
            "callback": null,
            "tip": "可输入汉字/拼音/缩写/区号"
        });
    //-->
    </script>
    <script type="text/javascript" src="http://i3.sinaimg.cn/unipro/pub/suda_m_v629.js"> </script>
    <script type="text/javascript">        suds_init(129, 100.00, 980, 2); </script>

<div style="z-index: 107; margin-top : 60px; float : left; width : 100%">
      <table style="margin-left : 0; float : left; width : 100%">
        <tr>
          <td>
           其他服务：
          </td>
          <td id="Th3" runat="server">
             <a href="./Stock.aspx" title= "股票信息侦听服务"><asp:Image ID="Image1" ImageUrl="./Pics/stock.jpg" runat="server" />
             </a>
           </td>
           <td id="Th1" runat="server">
             <a href="./QQOnline.aspx" title= "QQ在线侦听服务"><asp:Image ID="Image3" ImageUrl="./Pics/qq.jpg" runat="server" />
             </a>
           </td>
           <td id="Th2" runat="server">
             <a href="./AppleStore.aspx" title= ""><asp:Image ID="Image4" ImageUrl="./Pics/apple.jpg" runat="server" />
             </a>
           </td>
        </tr>
        <tr>
          <td></td>
          <td id="Td1" runat="server">
             <a href="./Stock.aspx" title= "股票信息侦听服务">股票信息侦听
             </a>
           </td>
           <td id="Td2" runat="server">
             <a href="./QQOnline.aspx" title= "QQ在线侦听服务">QQ在线侦听
             </a>
           </td>
           <td id="Td3" runat="server">
             <a href="./AppleStore.aspx" title= "苹果商店监测">苹果商店监测
             </a>
           </td>
        </tr>
       </table>
      <div style="z-index: 107; margin-left : 0; float : left; width : 100%">
                  <div style="z-index: 107; margin-top : 30px; float : left; width : 100%">
                 分享到：
                <div id="jiathis_style_32x32">
	                <a class="jiathis_button_tsina"></a>
	                <a class="jiathis_button_tqq"></a>
                    <a class="jiathis_button_qzone"></a>
	                <a class="jiathis_button_renren"></a>
	                <a class="jiathis_button_kaixin001"></a>
                    <a class="jiathis_button_douban"></a>
                    <a class="jiathis_button_tieba"></a>
                    <a class="jiathis_button_thexun"></a>
                    <a class="jiathis_button_51"></a>
                    <a class="jiathis_button_t163"></a>
                    <a class="jiathis_button_tsohu"></a>
                    <a class="jiathis_button_mop"></a>
                    <a class="jiathis_button_tianya"></a>
                    <a class="jiathis_button_fb"></a>
                    <a class="jiathis_button_msn"></a>
                    <a class="jiathis_button_twitter"></a>
                    <a class="jiathis_button_hi"></a>
                    <a class="jiathis_button_zhuaxia"></a>
	                <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	                <a class="jiathis_counter_style"></a>
                </div>
                <script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8">
                </script>
                <script type="text/javascript">
                    var jiathis_config = {
                        url: "http://www.shuyixia.com/Weather.aspx",
                        title: "这个网站很不错哦，可以给我发送免费的天气预报短信。"
                    }
                </script>
      </div>
      </div>
</div>
</asp:Content>